{% extends "base_detail.html" %}

{% load i18n %}
{% load breadcrumbs %}
{% load details %}

{% block breadcrumbs %}
    {% add_crumb 'Home' '/' %}
    {% add_crumb 'Movements' 'movement_list' %}
    {% add_crumb object %}
{% endblock %}

{% block objectactions %}
{% if perms.stock.add_movement %}
<li class="add"><a title="{% trans 'Add' %}" href="{% url movement_add %}">{% trans 'Add' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.stock.change_movement %}
<li class="edit"><a title="{% trans 'Edit' %}" href="{% url movement_edit object.pk %}">{% trans 'Edit' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.stock.delete_movement %}
<li class="delete"><a title="{% trans 'Delete' %}" href="{% url movement_delete object.pk %}">{% trans 'Delete' %}</a></li>
{% endif %}
{% if perms.stock.view_movement %}
<li class="all"><a title="{% trans 'All' %}" href="{% url movement_list %}">{% trans 'All' %}</a></li>
{% endif %}
{% endblock %}

{% block sections %}
<div class="details">
    <table class="properties">
        {% property_table object "[['author', 'created'], ['origin', 'destination']]" %}
        {% property_table object.product_entry "['product', ['quantity', 'unit_price'], ['tax', 'discount']]" %}
        {% property_table object "['value']" %}
    </table>
</div>
{% endblock %}
